package cn.wsalix.templet.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import lombok.Data;
import lombok.EqualsAndHashCode;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import cn.anlaser.entity.SimpleEntity;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * @author jskyme 模板实体
 */
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "SITE_TEMPLET")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@EntityListeners({ AuditingEntityListener.class })
@Data
@EqualsAndHashCode(callSuper = false)
public class SiteTemplet extends SimpleEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4173272473220310459L;
	private String templetCode;//
	private String logo;// 预览
	private String defaultPage = "default";// 默认
	private String savePath; //
	private String version;

	/*@JsonIgnore
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "siteTemplet")
	private List<SitePage> sitePages = new ArrayList<SitePage>();
	
	@ManyToOne(cascade = CascadeType.MERGE, optional = true, fetch = FetchType.LAZY)
	@JoinColumn(name = "SITE_ID")
	private SiteInfo siteInfo;// 当前站点对应的模板
	
	@ManyToOne(cascade = CascadeType.MERGE, optional = true, fetch = FetchType.LAZY)
	@JoinColumn(name = "TEMP_ID")
	private Templet templet;// 当前站点对应的模板
*/}
